package com.pig4cloud.pig.yu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pig.yu.entity.CarBrandEntity;
import com.pig4cloud.pig.yu.mapper.CarBrandMapper;
import com.pig4cloud.pig.yu.service.CarBrandService;
import org.springframework.stereotype.Service;
/**
 * car_brand
 */
@Service
public class CarBrandServiceImpl extends ServiceImpl<CarBrandMapper, CarBrandEntity> implements CarBrandService {
	public boolean checkBrandName(String brandName) {
		LambdaQueryWrapper<CarBrandEntity> wrapper = Wrappers.lambdaQuery();
		wrapper.eq(CarBrandEntity::getBrandName, brandName);
		return this.count(wrapper) > 0;
	}
	public CarBrandEntity getByBrandName(String brandName) {
		LambdaQueryWrapper<CarBrandEntity> wrapper = Wrappers.lambdaQuery();
		wrapper.eq(CarBrandEntity::getBrandName, brandName);
		return this.getOne(wrapper);
	}
}